From: Chong Yidong Date: Sun, 12 Feb 2012 09:46:33 +0000 (+0800) Subject: Avoid a risky corner case with invalid face ids. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~324^2~786 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=45ad2d2b6aa6d99068a7752a3a9358464df5bf25;p=emacs.git Avoid a risky corner case with invalid face ids. * src/xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here, as that creates a dangerous corner case. --- diff --git a/src/ChangeLog b/src/ChangeLog index 3028b91be7d..875b245f61c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2012-02-12 Chong Yidong + * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here, + as that creates a dangerous corner case. + * window.c (Fdelete_window_internal): Invalidate the mouse highlight (Bug#9904). diff --git a/src/xdisp.c b/src/xdisp.c index 75ea519e82e..70c12497e20 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -2750,9 +2750,12 @@ init_iterator (struct it *it, struct window *w, if (charpos >= BUF_BEG (current_buffer)) { it->end_charpos = ZV; - it->face_id = -1; IT_CHARPOS (*it) = charpos; + /* We will rely on `reseat' to set this up properly, via + handle_face_prop. */ + it->face_id = it->base_face_id; + /* Compute byte position if not specified. */ if (bytepos < charpos) IT_BYTEPOS (*it) = CHAR_TO_BYTE (charpos);